#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <QWidget>
#include "recvthread.h"
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void uiInit(void);
private slots:
    void showRecv(const QString &s);
    void on_btnOpen_clicked();
protected:
    void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
private:
    Ui::MainWindow *ui;
    double getData(double time);
    QSerialPort *mySerialPort;
   QSerialPortInfo *mySerialInfo;
   bool btnOpenIsOpen;
   bool btnSendIsSend;
   QTimer *timer;
   RecvThread *recvThread;
   RecvThread *sendThread;
   unsigned int recvBytes;
   unsigned int sendBytes;

};

#endif // MAINWINDOW_H
